home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
memory
/
emsaw41s.zip
/
TEST2C.C
< prev
next >
Wrap
Text File
|
1994-06-26
|
2KB
|
90 lines
/* test2c.c */
#include <type400.c>
#include <c:\tc\include\stdio.h>
#include <c:\tc\include\math.h>
void main()
{
int A, B, C, D, two, ten, sixfo, theto, ival2, four, fivei;
unsigned int arin64[32], arout64[32];
long totsiz, avsiz, te, hun, fivto,maxdim[5], actelem[5];
float rval1, rval2;
long double ththe, eval2;
EMINIT();
two=2;
SIZA (&totsiz, &avsiz, &two);
printf ("%7ld %7ld\n",totsiz,avsiz);
fivto=50000;
NEWA (&A, &fivto, &two);
theto=30000;
SETEL (&A, &fivto, &theto);
GETEL (&A, &fivto, &ival2);
printf ("%7d %7d\n",theto, ival2);
printf("end 2 by int\n");
printf("\n");
getchar();
FREEA(&A);
ten=10;
SIZA (&totsiz, &avsiz, &ten);
printf ("%7ld %7ld\n",totsiz,avsiz);
hun=100;
NEWA2 (&B, &hun, &hun, (int*)&ten);
ththe=30000.0;
SETEL2 (&B, &hun, &hun, (long*)&ththe);
GETEL2 (&B, &hun, &hun, (long*)&eval2);
printf ("%e %e\n",(double)ththe, (double)eval2);
printf ("end 10 by real\n");
printf ("\n");
getchar();
FREEA(&B);
/* The rest of the program can be executed with full version of the
package*/
/*
SIZA (&totsiz, &avsiz, &sixfo);
printf ("%7ld %7ld\n",totsiz,avsiz);
te=10;
sixfo=64;
NEWA3 (&C, &te, &te, &te, (int*)&sixfo);
arin64[1]=30000;
SETEL3 (&C, &te, &te, &te, (long*)&arin64[0]);
GETEL3 (&C, &te, &te, &te, (long*)&arout64[0]);
printf ("%7d %7d\n",arin64[1], arout64[1]);
printf("end 3-D 64 by int array\n");
printf("\n");
getchar();
FREEA(&C);
four=4;
SIZA(&totsiz,&avsiz,(int*)&four);
printf ("%7ld %7ld\n",totsiz,avsiz);
maxdim[0]=40;
maxdim[1]=10;
maxdim[2]=10;
maxdim[3]=10;
maxdim[4]=10;
fivei=5;
NEWAN(&D,&maxdim[0],&fivei,(int*)&four);
rval1=30000.0;
actelem[0]=40;
actelem[1]=10;
actelem[2]=10;
actelem[3]=10;
actelem[4]=10;
SETELN(&D,&actelem[0], (long int*)&rval1);
GETELN(&D,&actelem[0], (long int*)&rval2);
printf ("%7e %7e\n",rval1, rval2);
printf("end 5-D 4 by real\n");
printf("\n");
getchar();
FREEA(&D);
*/
}